<?php

/**
 * Follow form.
 *
 * @package    explications_informatiques
 * @subpackage form
 * @author     Guimezanes Cyrille
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class RecomandForm extends BaseFollowForm
{
  public function configure()
  {
	  $this->disableLocalCSRFProtection();
  }
  public function setup()
  {
	  $this->setWidgets(array(
      'id'      => new sfWidgetFormInputHidden(),
      'id_asso' => new sfWidgetFormInputHidden(),
      'email'   => new sfWidgetFormInputText(array(), array("size"=> 70)),
	  'texte'   => new sfWidgetFormTextarea(array(), array("cols" => 77,"rows"=>5)),
    ));

    $this->setValidators(array(
      'id'      => new sfValidatorString(array('required' => false)),
      'id_asso' => new sfValidatorString(array('required' => false)),
      'email'   => new sfValidatorEmail(array(), array('invalid' => 'Email invalide')),
	  'texte' => new sfValidatorString(array('required' => false)),
    ));
	$this->widgetSchema->setLabels(array(
     
      'email'    => "Adresse email",
	  'texte'    => "Ajouter un texte",
    ));
	$this->widgetSchema->setHelps(array(
      
      'email'    => "Adresse email à laquelle sera envoyé la recommandation",
	  'texte'    => "Vous pouvez écrire ici un texte qui sera ajouté automatiquement à l'email",
    ));
    $this->widgetSchema->setNameFormat('recomand[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();
  }
}
